﻿@model LogManager.ViewModels.ImportList
       
@using MvcContrib.UI.Grid;
@using MvcContrib.Pagination;
@using MvcContrib.UI.Pager;
@using LogManager.Helpers;       
           
<div class="imports">
    @(Html.Pager(Model.Imports).First("First").Previous("Previous").Next("Next").Last("Last"))
    <br />
    @(Html.Grid<LogManager.Base.IEventImport>(Model.Imports).Columns(column =>
    {
        column.For(e => e.ServerName).Header("Server");
        column.For(e => Html.ActionLink(e.LogName, "Detail", "Log", new { logName = e.LogName, serverName = e.ServerName }, null)).Named("LogName").Header("Log");
        column.For(i => i.ImportDate);
        column.For(i => i.Start);
        column.For(i => i.End);
        column.For(i => i.Progress).Format("{0} %");
        column.For(i => i.Amount);
    }).Sort(Model.SortOptions))  
    @(Html.Pager(Model.Imports).First("First").Previous("Previous").Next("Next").Last("Last"))
    <br />  
</div>

<script type="text/javascript">
    jQuery(document).ready(function () {
        $.ajaxLinkHandler('.logs .pagination a, .logs th a', '-logs', '-logs .grid');
    });
</script>

<script type="text/javascript">
    jQuery(document).ready(function () {
        $.ajaxLinkHandler('.imports .pagination a, .imports th a', '.imports', '.imports .grid');
    });
</script>